package com.sky.proxy.staticProxy;

public interface Star {


    /**
     * 唱歌
     */
    void sing(String song);

}

class Singer implements Star {

    private String name;

    Singer(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public void sing(String song) {
        System.out.println(this.getName() + " 正在演唱 " + song);
    }

}

class SingerProxy implements Star {

    private Star star;

    SingerProxy(Star star) {
        this.star = star;
    }


    @Override
    public void sing(String song) {
        System.out.println("面谈");
        System.out.println("签合同");
        System.out.println("卖票");
        star.sing(song);
        System.out.println("收钱");
    }


}


class Concert {

    public static void main(String[] args) {
        Star star = new Singer("周杰伦");
        SingerProxy proxy = new SingerProxy(star);
        proxy.sing("七里香");
    }
}

